/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Mobilottery.UI.Forms;

import Mobilottery.AppManager;
import Mobilottery.Constants.Consts;
import Mobilottery.Constants.Consts.Screens;
import javax.microedition.lcdui.*;

/**
 *
 * @author WindowsVista
 */
public class FormAbout extends Form implements CommandListener
{

    public FormAbout()
    {
        super("About");

        Command cmd;
        ImageItem img;

        img = new ImageItem(
                null,
                Consts.UIConsts.IMAGES_LOGO,
                Item.LAYOUT_LEFT,
                "MOBILottery",
                Item.PLAIN);
        this.append(img);

        StringItem si = new StringItem("Authors", null);
        si.setLayout(Item.LAYOUT_LEFT);
        this.append(si);

        si = new StringItem(null, "- Sami Emuna\r\n- Yariv Avramovitch\r\n- Ziv Haziz\r\n- Amit Zohar\r\n- Fedor Losev");
        si.setLayout(Item.LAYOUT_LEFT);
        this.append(si);

        si = new StringItem("Version", "- 1.0a\r\n");
        si.setLayout(Item.LAYOUT_LEFT);
        this.append(si);

        cmd = new Command("Back", Command.BACK, 0);
        this.addCommand(cmd);

        this.setCommandListener(this);
    }

    public void commandAction(Command c, Displayable d)
    {
        int cmdType = c.getCommandType();
        if (cmdType == Command.BACK)
        {
            back_Clicked();
        }
    }

    private void back_Clicked()
    {
        AppManager.goToScreen(Screens.MainMenu, null);
    }
}